//
//  FilmTableViewCell.m
//  UI12豆瓣大项目
//
//  Created by 李奇 on 15/10/31.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "FilmTableViewCell.h"
#import "UIImageView+WebCache.h"
@implementation FilmTableViewCell
- (void)dealloc
{
    [_movieImageView release];
    [_movieNameLabel release];
    [_activiy release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatCell];
    }
    return self;
}

-(void)creatCell{
    UIImage *bgImage = [UIImage imageNamed:@"bg_eventlistcell.png"];
    UIImageView *bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 10, 350, 124)];
    bgImageView.image = bgImage;
    [self.contentView addSubview:bgImageView];
    
    self.movieImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 2, 87, 120)];
    [bgImageView addSubview:self.movieImageView];
    [self.movieImageView release];
    
    self.movieNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 45, 230, 30)];
    [bgImageView addSubview:self.movieNameLabel];
    [self.movieNameLabel release];
    
}

-(void)setActiviy:(Activity *)activiy{
    if (_activiy != activiy) {
        [_activiy release];
        _activiy = [activiy retain];
    }
    self.movieNameLabel.text = self.activiy.movieName;
    
    //有缓存的第三方
    [self.movieImageView sd_setImageWithURL:[NSURL  URLWithString:self.activiy.pic_url] placeholderImage:[UIImage imageNamed:@"placeHoderImage"]];

    
}

@end
